import router from './router'
import store from './store'
import NProgress from 'nprogress' // Progress 进度条
import 'nprogress/nprogress.css'// Progress 进度条样式


router.beforeEach((to, from, next) => {
    if(to.meta.check && !store.getters.useInfo.token){
        next('/login');
        NProgress.done(); 
        return;
    }
    NProgress.start(); 
    next();
})
router.afterEach(() => {
    NProgress.done();  // 结束Progress
})
